const { merge } = require('webpack-merge')
const common = require('./webpack.common')
const prod = require('./webpack.prod')
const dev = require('./webpack.dev')

module.exports = argv => {
  switch (argv) {
    case 'development':
      return merge(common, dev)
    case 'production':
      return merge(common, prod)
    default:
      throw new Error('No matching configuration was found!')
  }
}
